import { Vector3 } from "stl-typescript"
export type VerticesId = number
export type FaceId = number

export interface VertexPoint {
    id: number
    XYZ: number[]
}

export interface Edge {
    id?: number
    vertexIds: VerticesId[]
}
export interface MeshEdgeData {
    minDistance?: number
    cellId?: number
    partId?: number
    start?: number[]
    end?: number[]
    elementEdgeNodeId?: number
    elementEdgeSecondNodeId?: number
    uid: string
}
export interface Face {
    id: number
    vertexIds: VerticesId[]
    normals?: []
}

export interface Mesh {
    id: number
    name?: string
    faceIds: FaceId[]
}

export interface Group {
    id: number
    name?: string
    // 子对象
    children: Mesh[]
}

export interface CommonDataStructure {
    vertices: VertexPoint[]
    edges?: Edge[]
    faces?: Face[]
    outlines?: Edge[]
    groups?: Group[]
}

export enum ACTOR_TYPE {
    VT_ACTOR = "VT_ACTOR",
    GRAPHIC_ACTOR = "GRAPHIC_ACTOR",
    WIDGET = "WIDGET",
    LABEL = "LABEL",
}

// 声明了vtk.js中RenderWindowInteractor的callback参数
export interface IMouseEvent {
    altKey: boolean
    controlKey: boolean
    shiftKey: boolean
    position: { x: number; y: number; z: number }
    type: string
}

export interface IKeyEvent {
    altKey: boolean
    controlKey: boolean
    shiftKey: boolean
    key: string
    keyCode: number
    type: string
}

export enum EdgeType {
    FREE = 1, // * 自由边
    SHARE = 2, // * 共享边
    INTERNAL = 3, // * 内部边
}

export enum HookType {
    AFTER_RENDER = 1, // * 渲染后
}

export interface LineOptions {
    color?: [number, number, number]
    lineWidth?: number
}
